using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VWPREPOS
    {
        public DataRow Convert2WPREPOS(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryWPREPOS(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["WRPMANDANT"] = " ".PadRight(2 ); 
         dwReturn["WRPLIEFNR"] = " ".PadRight(8 ); 
         dwReturn["WRPREART"] = " ".PadRight(1 ); 
         dwReturn["WRPRENR"] = " ".PadRight(15 ); 
         dwReturn["WRPREPOS"] = " ".PadRight(3 ); 
         dwReturn["WRPAENZL"] = " ".PadRight(0 ); 
         dwReturn["WRPAENB"] = " ".PadRight(8 ); 
         dwReturn["WRPAEND"] = " ".PadRight(0 ); 
         dwReturn["WRPNEUB"] = " ".PadRight(8 ); 
         dwReturn["WRPNEUD"] = " ".PadRight(0 ); 
         dwReturn["WRPAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["WRPAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["WRPAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["WRPAFOLGE"] = " ".PadRight(3 ); 
         dwReturn["WRPANLIEF"] = " ".PadRight(4 ); 
         dwReturn["WRPVANZ"] = " ".PadRight(15 ); 
         dwReturn["WRPKONTO"] = " ".PadRight(10 ); 
         dwReturn["WRPWAKZ"] = " ".PadRight(1 ); 
         dwReturn["WRPKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["WRPWERK"] = " ".PadRight(3 ); 
         dwReturn["WRPABT"] = " ".PadRight(3 ); 
         dwReturn["WRPART"] = " ".PadRight(20 ); 
         dwReturn["WRPVAR"] = " ".PadRight(3 ); 
         dwReturn["WRPFARBE"] = " ".PadRight(10 ); 
         dwReturn["WRPDESS"] = " ".PadRight(10 ); 
         dwReturn["WRPCOLORIT"] = " ".PadRight(10 ); 
         dwReturn["WRPBESCHICH"] = " ".PadRight(10 ); 
         dwReturn["WRPNETTO"] = " ".PadRight(0 ); 
         dwReturn["WRPSTANET"] = " ".PadRight(1 ); 
         dwReturn["WRPVERPACK"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAVERP"] = " ".PadRight(1 ); 
         dwReturn["WRPFRACHT"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAFRA"] = " ".PadRight(1 ); 
         dwReturn["WRPVERSICH"] = " ".PadRight(0 ); 
         dwReturn["WRPZOLL"] = " ".PadRight(0 ); 
         dwReturn["WRPREWERT"] = " ".PadRight(0 ); 
         dwReturn["WRPAMKST"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAAMK"] = " ".PadRight(1 ); 
         dwReturn["WRPPAUWERT"] = " ".PadRight(0 ); 
         dwReturn["WRPKZAM1"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM1"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT1"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM1"] = " ".PadRight(1 ); 
         dwReturn["WRPKZAM2"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM2"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT2"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM2"] = " ".PadRight(1 ); 
         dwReturn["WRPKZAM3"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM3"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT3"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM3"] = " ".PadRight(1 ); 
         dwReturn["WRPKZAM4"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM4"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT4"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM4"] = " ".PadRight(1 ); 
         dwReturn["WRPKZAM5"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM5"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT5"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM5"] = " ".PadRight(1 ); 
         dwReturn["WRPKZAM6"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM6"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT6"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM6"] = " ".PadRight(1 ); 
         dwReturn["WRPKZAM7"] = " ".PadRight(1 ); 
         dwReturn["WRPMRKM7"] = " ".PadRight(4 ); 
         dwReturn["WRPMWERT7"] = " ".PadRight(0 ); 
         dwReturn["WRPSTAMRKM7"] = " ".PadRight(1 ); 
         dwReturn["WRPKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["WRPKST"] = " ".PadRight(4 ); 
         dwReturn["WRPSACHB"] = " ".PadRight(8 ); 
         dwReturn["WRPGESSTA"] = " ".PadRight(1 ); 
         dwReturn["WRPFILLER"] = " ".PadRight(103 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapWPREPOS(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveWPREPOS(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryWPREPOS(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapWPREPOS(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertWPREPOS(dwLocal, ITXDBVERSION);
            }
            UpdateWPREPOS(dwLocal);
        }
        public void InsertWPREPOS(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO WPREPOS(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryWPREPOS(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM WPREPOS WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM WPREPOS  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WPREPOS";
            Return = Result;
            return Return;
        }
        public void DeleteWPREPOS(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM WPREPOS   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateWPREPOS(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE WPREPOS SET "
                    +"WRPMANDANT= :WRPMANDANT,"
                    +"WRPLIEFNR= :WRPLIEFNR,"
                    +"WRPREART= :WRPREART,"
                    +"WRPRENR= :WRPRENR,"
                    +"WRPREPOS= :WRPREPOS,"
                    +"WRPAENZL= :WRPAENZL,"
                    +"WRPAENB= :WRPAENB,"
                    +"WRPAEND= :WRPAEND,"
                    +"WRPNEUB= :WRPNEUB,"
                    +"WRPNEUD= :WRPNEUD,"
                    +"WRPAUFKRS= :WRPAUFKRS,"
                    +"WRPAUFLFD= :WRPAUFLFD,"
                    +"WRPAUFPOS= :WRPAUFPOS,"
                    +"WRPAFOLGE= :WRPAFOLGE,"
                    +"WRPANLIEF= :WRPANLIEF,"
                    +"WRPVANZ= :WRPVANZ,"
                    +"WRPKONTO= :WRPKONTO,"
                    +"WRPWAKZ= :WRPWAKZ,"
                    +"WRPKUNDNR= :WRPKUNDNR,"
                    +"WRPWERK= :WRPWERK,"
                    +"WRPABT= :WRPABT,"
                    +"WRPART= :WRPART,"
                    +"WRPVAR= :WRPVAR,"
                    +"WRPFARBE= :WRPFARBE,"
                    +"WRPDESS= :WRPDESS,"
                    +"WRPCOLORIT= :WRPCOLORIT,"
                    +"WRPBESCHICH= :WRPBESCHICH,"
                    +"WRPNETTO= :WRPNETTO,"
                    +"WRPSTANET= :WRPSTANET,"
                    +"WRPVERPACK= :WRPVERPACK,"
                    +"WRPSTAVERP= :WRPSTAVERP,"
                    +"WRPFRACHT= :WRPFRACHT,"
                    +"WRPSTAFRA= :WRPSTAFRA,"
                    +"WRPVERSICH= :WRPVERSICH,"
                    +"WRPZOLL= :WRPZOLL,"
                    +"WRPREWERT= :WRPREWERT,"
                    +"WRPAMKST= :WRPAMKST,"
                    +"WRPSTAAMK= :WRPSTAAMK,"
                    +"WRPPAUWERT= :WRPPAUWERT,"
                    +"WRPKZAM1= :WRPKZAM1,"
                    +"WRPMRKM1= :WRPMRKM1,"
                    +"WRPMWERT1= :WRPMWERT1,"
                    +"WRPSTAMRKM1= :WRPSTAMRKM1,"
                    +"WRPKZAM2= :WRPKZAM2,"
                    +"WRPMRKM2= :WRPMRKM2,"
                    +"WRPMWERT2= :WRPMWERT2,"
                    +"WRPSTAMRKM2= :WRPSTAMRKM2,"
                    +"WRPKZAM3= :WRPKZAM3,"
                    +"WRPMRKM3= :WRPMRKM3,"
                    +"WRPMWERT3= :WRPMWERT3,"
                    +"WRPSTAMRKM3= :WRPSTAMRKM3,"
                    +"WRPKZAM4= :WRPKZAM4,"
                    +"WRPMRKM4= :WRPMRKM4,"
                    +"WRPMWERT4= :WRPMWERT4,"
                    +"WRPSTAMRKM4= :WRPSTAMRKM4,"
                    +"WRPKZAM5= :WRPKZAM5,"
                    +"WRPMRKM5= :WRPMRKM5,"
                    +"WRPMWERT5= :WRPMWERT5,"
                    +"WRPSTAMRKM5= :WRPSTAMRKM5,"
                    +"WRPKZAM6= :WRPKZAM6,"
                    +"WRPMRKM6= :WRPMRKM6,"
                    +"WRPMWERT6= :WRPMWERT6,"
                    +"WRPSTAMRKM6= :WRPSTAMRKM6,"
                    +"WRPKZAM7= :WRPKZAM7,"
                    +"WRPMRKM7= :WRPMRKM7,"
                    +"WRPMWERT7= :WRPMWERT7,"
                    +"WRPSTAMRKM7= :WRPSTAMRKM7,"
                    +"WRPKSTKRS= :WRPKSTKRS,"
                    +"WRPKST= :WRPKST,"
                    +"WRPSACHB= :WRPSACHB,"
                    +"WRPGESSTA= :WRPGESSTA,"
                    +"WRPFILLER= :WRPFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("WRPMANDANT", OracleType.NVarChar).Value = dwData["WRPMANDANT"].ToString(); 
          or1.Parameters.Add("WRPLIEFNR", OracleType.NVarChar).Value = dwData["WRPLIEFNR"].ToString(); 
          or1.Parameters.Add("WRPREART", OracleType.NVarChar).Value = dwData["WRPREART"].ToString(); 
          or1.Parameters.Add("WRPRENR", OracleType.NVarChar).Value = dwData["WRPRENR"].ToString(); 
          or1.Parameters.Add("WRPREPOS", OracleType.NVarChar).Value = dwData["WRPREPOS"].ToString(); 
          or1.Parameters.Add("WRPAENZL", OracleType.NVarChar).Value = dwData["WRPAENZL"].ToString(); 
          or1.Parameters.Add("WRPAENB", OracleType.NVarChar).Value = dwData["WRPAENB"].ToString(); 
          or1.Parameters.Add("WRPAEND", OracleType.NVarChar).Value = dwData["WRPAEND"].ToString(); 
          or1.Parameters.Add("WRPNEUB", OracleType.NVarChar).Value = dwData["WRPNEUB"].ToString(); 
          or1.Parameters.Add("WRPNEUD", OracleType.NVarChar).Value = dwData["WRPNEUD"].ToString(); 
          or1.Parameters.Add("WRPAUFKRS", OracleType.NVarChar).Value = dwData["WRPAUFKRS"].ToString(); 
          or1.Parameters.Add("WRPAUFLFD", OracleType.NVarChar).Value = dwData["WRPAUFLFD"].ToString(); 
          or1.Parameters.Add("WRPAUFPOS", OracleType.NVarChar).Value = dwData["WRPAUFPOS"].ToString(); 
          or1.Parameters.Add("WRPAFOLGE", OracleType.NVarChar).Value = dwData["WRPAFOLGE"].ToString(); 
          or1.Parameters.Add("WRPANLIEF", OracleType.NVarChar).Value = dwData["WRPANLIEF"].ToString(); 
          or1.Parameters.Add("WRPVANZ", OracleType.NVarChar).Value = dwData["WRPVANZ"].ToString(); 
          or1.Parameters.Add("WRPKONTO", OracleType.NVarChar).Value = dwData["WRPKONTO"].ToString(); 
          or1.Parameters.Add("WRPWAKZ", OracleType.NVarChar).Value = dwData["WRPWAKZ"].ToString(); 
          or1.Parameters.Add("WRPKUNDNR", OracleType.NVarChar).Value = dwData["WRPKUNDNR"].ToString(); 
          or1.Parameters.Add("WRPWERK", OracleType.NVarChar).Value = dwData["WRPWERK"].ToString(); 
          or1.Parameters.Add("WRPABT", OracleType.NVarChar).Value = dwData["WRPABT"].ToString(); 
          or1.Parameters.Add("WRPART", OracleType.NVarChar).Value = dwData["WRPART"].ToString(); 
          or1.Parameters.Add("WRPVAR", OracleType.NVarChar).Value = dwData["WRPVAR"].ToString(); 
          or1.Parameters.Add("WRPFARBE", OracleType.NVarChar).Value = dwData["WRPFARBE"].ToString(); 
          or1.Parameters.Add("WRPDESS", OracleType.NVarChar).Value = dwData["WRPDESS"].ToString(); 
          or1.Parameters.Add("WRPCOLORIT", OracleType.NVarChar).Value = dwData["WRPCOLORIT"].ToString(); 
          or1.Parameters.Add("WRPBESCHICH", OracleType.NVarChar).Value = dwData["WRPBESCHICH"].ToString(); 
          or1.Parameters.Add("WRPNETTO", OracleType.NVarChar).Value = dwData["WRPNETTO"].ToString(); 
          or1.Parameters.Add("WRPSTANET", OracleType.NVarChar).Value = dwData["WRPSTANET"].ToString(); 
          or1.Parameters.Add("WRPVERPACK", OracleType.NVarChar).Value = dwData["WRPVERPACK"].ToString(); 
          or1.Parameters.Add("WRPSTAVERP", OracleType.NVarChar).Value = dwData["WRPSTAVERP"].ToString(); 
          or1.Parameters.Add("WRPFRACHT", OracleType.NVarChar).Value = dwData["WRPFRACHT"].ToString(); 
          or1.Parameters.Add("WRPSTAFRA", OracleType.NVarChar).Value = dwData["WRPSTAFRA"].ToString(); 
          or1.Parameters.Add("WRPVERSICH", OracleType.NVarChar).Value = dwData["WRPVERSICH"].ToString(); 
          or1.Parameters.Add("WRPZOLL", OracleType.NVarChar).Value = dwData["WRPZOLL"].ToString(); 
          or1.Parameters.Add("WRPREWERT", OracleType.NVarChar).Value = dwData["WRPREWERT"].ToString(); 
          or1.Parameters.Add("WRPAMKST", OracleType.NVarChar).Value = dwData["WRPAMKST"].ToString(); 
          or1.Parameters.Add("WRPSTAAMK", OracleType.NVarChar).Value = dwData["WRPSTAAMK"].ToString(); 
          or1.Parameters.Add("WRPPAUWERT", OracleType.NVarChar).Value = dwData["WRPPAUWERT"].ToString(); 
          or1.Parameters.Add("WRPKZAM1", OracleType.NVarChar).Value = dwData["WRPKZAM1"].ToString(); 
          or1.Parameters.Add("WRPMRKM1", OracleType.NVarChar).Value = dwData["WRPMRKM1"].ToString(); 
          or1.Parameters.Add("WRPMWERT1", OracleType.NVarChar).Value = dwData["WRPMWERT1"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM1", OracleType.NVarChar).Value = dwData["WRPSTAMRKM1"].ToString(); 
          or1.Parameters.Add("WRPKZAM2", OracleType.NVarChar).Value = dwData["WRPKZAM2"].ToString(); 
          or1.Parameters.Add("WRPMRKM2", OracleType.NVarChar).Value = dwData["WRPMRKM2"].ToString(); 
          or1.Parameters.Add("WRPMWERT2", OracleType.NVarChar).Value = dwData["WRPMWERT2"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM2", OracleType.NVarChar).Value = dwData["WRPSTAMRKM2"].ToString(); 
          or1.Parameters.Add("WRPKZAM3", OracleType.NVarChar).Value = dwData["WRPKZAM3"].ToString(); 
          or1.Parameters.Add("WRPMRKM3", OracleType.NVarChar).Value = dwData["WRPMRKM3"].ToString(); 
          or1.Parameters.Add("WRPMWERT3", OracleType.NVarChar).Value = dwData["WRPMWERT3"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM3", OracleType.NVarChar).Value = dwData["WRPSTAMRKM3"].ToString(); 
          or1.Parameters.Add("WRPKZAM4", OracleType.NVarChar).Value = dwData["WRPKZAM4"].ToString(); 
          or1.Parameters.Add("WRPMRKM4", OracleType.NVarChar).Value = dwData["WRPMRKM4"].ToString(); 
          or1.Parameters.Add("WRPMWERT4", OracleType.NVarChar).Value = dwData["WRPMWERT4"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM4", OracleType.NVarChar).Value = dwData["WRPSTAMRKM4"].ToString(); 
          or1.Parameters.Add("WRPKZAM5", OracleType.NVarChar).Value = dwData["WRPKZAM5"].ToString(); 
          or1.Parameters.Add("WRPMRKM5", OracleType.NVarChar).Value = dwData["WRPMRKM5"].ToString(); 
          or1.Parameters.Add("WRPMWERT5", OracleType.NVarChar).Value = dwData["WRPMWERT5"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM5", OracleType.NVarChar).Value = dwData["WRPSTAMRKM5"].ToString(); 
          or1.Parameters.Add("WRPKZAM6", OracleType.NVarChar).Value = dwData["WRPKZAM6"].ToString(); 
          or1.Parameters.Add("WRPMRKM6", OracleType.NVarChar).Value = dwData["WRPMRKM6"].ToString(); 
          or1.Parameters.Add("WRPMWERT6", OracleType.NVarChar).Value = dwData["WRPMWERT6"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM6", OracleType.NVarChar).Value = dwData["WRPSTAMRKM6"].ToString(); 
          or1.Parameters.Add("WRPKZAM7", OracleType.NVarChar).Value = dwData["WRPKZAM7"].ToString(); 
          or1.Parameters.Add("WRPMRKM7", OracleType.NVarChar).Value = dwData["WRPMRKM7"].ToString(); 
          or1.Parameters.Add("WRPMWERT7", OracleType.NVarChar).Value = dwData["WRPMWERT7"].ToString(); 
          or1.Parameters.Add("WRPSTAMRKM7", OracleType.NVarChar).Value = dwData["WRPSTAMRKM7"].ToString(); 
          or1.Parameters.Add("WRPKSTKRS", OracleType.NVarChar).Value = dwData["WRPKSTKRS"].ToString(); 
          or1.Parameters.Add("WRPKST", OracleType.NVarChar).Value = dwData["WRPKST"].ToString(); 
          or1.Parameters.Add("WRPSACHB", OracleType.NVarChar).Value = dwData["WRPSACHB"].ToString(); 
          or1.Parameters.Add("WRPGESSTA", OracleType.NVarChar).Value = dwData["WRPGESSTA"].ToString(); 
          or1.Parameters.Add("WRPFILLER", OracleType.NVarChar).Value = dwData["WRPFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
